package com.tis.database.entitys.security;

// Generated Aug 27, 2013 11:48:51 PM by Hibernate Tools 4.0.0

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedNativeQueries;
import javax.persistence.NamedNativeQuery;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import com.tis.database.dao.ClsInstance;

/**
 * AdUserLogin generated by hbm2java
 */
@Entity
@Table(name =ClsInstance.INTERFACE_SCHEMA + ClsInstance.POINTER + "AD_USER_LOGIN")
@NamedQueries({
    @NamedQuery(name = AdUserLogin.findAll, query = "from AdUserLogin c WHERE 1 = 1 "),
    @NamedQuery(name = AdUserLogin.findById, query = "from AdUserLogin c WHERE  c.pkId = :pkId "),
    @NamedQuery(name = AdUserLogin.findByUserPassword, query = "from AdUserLogin c WHERE  c.userLogin = :userLogin and c.password = :password ")
})
@NamedNativeQueries({
	@NamedNativeQuery(name = AdUserLogin.NativeSQLfindByUserPassword, query = " SELECT * FROM AD_USER_LOGIN C WHERE C.USER_LOGIN = :userLogin AND C.PASSWORD = :password ", resultClass = AdUserLogin.class),
	@NamedNativeQuery(name = AdUserLogin.NativeSQLfindByUserLogin, query = " SELECT * FROM AD_USER_LOGIN C WHERE C.USER_LOGIN = :userLogin ", resultClass = AdUserLogin.class)
})
public class AdUserLogin implements java.io.Serializable {
	private static final long serialVersionUID = 1L;
	
	@Transient
	public static final String findAll = "AdUserLogin_findAll";
	
	@Transient
	public static final String findById = "AdUserLogin_findById";
	
	@Transient
	public static final String findByUserPassword = "AdUserLogin_findByUserPassword";
	
	@Transient
	public static final String NativeSQLfindByUserPassword = "AdUserLogin_NativeSQLfindByUserPassword";
	
	@Transient
	public static final String NativeSQLfindByUserLogin = "AdUserLogin_NativeSQLfindByUserLogin";
	
	@Id
	@Column(name = "AD_USER_LOGIN_ID", unique = true, nullable = false, precision = 20, scale = 0)
	private BigDecimal pkId;
	
	@Column(name = "LASTED_ACCESS_KEY", length = 100)
	private String lastedAccessKey;
	
	@Column(name = "VERSION", length = 500)
	private String version;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name = "AD_USER_GROUP_ID", nullable=false)
	private AdUserGroup adUserGroup;
	
	@Column(name = "USER_LOGIN", length = 100)
	private String userLogin;
	
	@Column(name = "PASSWORD", length = 1000)
	private String password;
	
	@Column(name = "TITLE_NAME", length = 1000)
	private String titleName;
	
	@Column(name = "FIRST_NAME", length = 1000)
	private String firstName;
	
	@Column(name = "LAST_NAME", length = 1000)
	private String lastName;
	
	@Column(name = "DESCRIPTION", length = 2000)
	private String description;
	
	@Column(name = "DESCRIPTION_ALTERNATE", length = 2000)
	private String descriptionAlternate;
	
	@Column(name = "AD_ACTIVE_DIRECTORY_ID", precision = 20, scale = 0)
	private BigDecimal adActiveDirectoryId;
	
	@Column(name = "ISACTIVE", length = 1)
	private String isactive;
	
	@Column(name = "ISDELETED", length = 1)
	private String isdeleted;
	
	@Column(name = "STATUS", length = 100)
	private String status;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATED_ON")
	private Date createdOn;
	
	@Column(name = "CREATED_BY", length = 500)
	private String createdBy;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UPDATED_ON")
	private Date updatedOn;
	
	@Column(name = "UPDATED_BY", length = 500)
	private String updatedBy;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DELETED_ON")
	private Date deletedOn;
	
	@Column(name = "DELETED_BY", length = 500)
	private String deletedBy;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FIRST_ACCESS")
	private Date firstAccess;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "LASTED_ACCESS")
	private Date lastedAccess;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "EXPIRED_DATE")
	private Date expiredDate;
	
	@Column(name = "LASTED_IP_ACCESS", length = 500)
	private String lastedIpAccess;
		
	@Column(name = "LASTED_COMP_ACCESS", length = 500)
	private String lastedCompAccess;
	
	/**
	 * @return the lastedAccessKey
	 * Date =Sep 26, 2013 : 4:09:57 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	public String getLastedAccessKey() {
		return lastedAccessKey;
	}

	/**
	 * @param lastedAccessKey the lastedAccessKey to set
	 * Date =Sep 26, 2013 : 4:09:57 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	public void setLastedAccessKey(String lastedAccessKey) {
		this.lastedAccessKey = lastedAccessKey;
	}

	@Override
	public String toString()
	{
		return ToStringBuilder.reflectionToString(this);
	}

	public AdUserLogin() {
	}

	public AdUserLogin(BigDecimal pkId) {
		this.pkId = pkId;
	}

	public AdUserLogin(BigDecimal pkId, AdUserGroup adUserGroup,
			String userLogin, String password, String titleName,
			String firstName, String lastName, String description,
			String descriptionAlternate, BigDecimal adActiveDirectoryId,
			String isactive, String isdeleted, String status, Date createdOn,
			String createdBy, Date updatedOn, String updatedBy, Date deletedOn,
			String deletedBy, Date firstAccess, Date lastedAccess,
			Date expiredDate, String lastedIpAccess, String lastedCompAccess) {
		this.pkId = pkId;
		this.adUserGroup = adUserGroup;
		this.userLogin = userLogin;
		this.password = password;
		this.titleName = titleName;
		this.firstName = firstName;
		this.lastName = lastName;
		this.description = description;
		this.descriptionAlternate = descriptionAlternate;
		this.adActiveDirectoryId = adActiveDirectoryId;
		this.isactive = isactive;
		this.isdeleted = isdeleted;
		this.status = status;
		this.createdOn = createdOn;
		this.createdBy = createdBy;
		this.updatedOn = updatedOn;
		this.updatedBy = updatedBy;
		this.deletedOn = deletedOn;
		this.deletedBy = deletedBy;
		this.firstAccess = firstAccess;
		this.lastedAccess = lastedAccess;
		this.expiredDate = expiredDate;
		this.lastedIpAccess = lastedIpAccess;
		this.lastedCompAccess = lastedCompAccess;
	}
	
	
	/**
	 * @return the pkId
	 */
	public BigDecimal getPkId() {
		return pkId;
	}

	/**
	 * @param pkId the pkId to set
	 */
	public void setPkId(BigDecimal pkId) {
		this.pkId = pkId;
	}
	
	public String getVersion() {
		return this.version;
	}

	public void setVersion(String version) {
		this.version = version;
	}
		
	public AdUserGroup getAdUserGroup() {
		return this.adUserGroup;
	}

	public void setAdUserGroup(AdUserGroup adUserGroup) {
		this.adUserGroup = adUserGroup;
	}
	
	public String getUserLogin() {
		return this.userLogin;
	}

	public void setUserLogin(String userLogin) {
		this.userLogin = userLogin;
	}
	
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
	public String getTitleName() {
		return this.titleName;
	}

	public void setTitleName(String titleName) {
		this.titleName = titleName;
	}
	
	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	
	public String getLastName() {
		return this.lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	public String getDescriptionAlternate() {
		return this.descriptionAlternate;
	}

	public void setDescriptionAlternate(String descriptionAlternate) {
		this.descriptionAlternate = descriptionAlternate;
	}

	
	public BigDecimal getAdActiveDirectoryId() {
		return this.adActiveDirectoryId;
	}

	public void setAdActiveDirectoryId(BigDecimal adActiveDirectoryId) {
		this.adActiveDirectoryId = adActiveDirectoryId;
	}
	
	public String getIsactive() {
		return this.isactive;
	}

	public void setIsactive(String isactive) {
		this.isactive = isactive;
	}
	
	public String getIsdeleted() {
		return this.isdeleted;
	}

	public void setIsdeleted(String isdeleted) {
		this.isdeleted = isdeleted;
	}
	
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	public Date getCreatedOn() {
		return this.createdOn;
	}

	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}
	
	public String getCreatedBy() {
		return this.createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	
	public Date getUpdatedOn() {
		return this.updatedOn;
	}

	public void setUpdatedOn(Date updatedOn) {
		this.updatedOn = updatedOn;
	}

	
	public String getUpdatedBy() {
		return this.updatedBy;
	}

	public void setUpdatedBy(String updatedBy) {
		this.updatedBy = updatedBy;
	}

	
	public Date getDeletedOn() {
		return this.deletedOn;
	}

	public void setDeletedOn(Date deletedOn) {
		this.deletedOn = deletedOn;
	}

	
	public String getDeletedBy() {
		return this.deletedBy;
	}

	public void setDeletedBy(String deletedBy) {
		this.deletedBy = deletedBy;
	}

	
	public Date getFirstAccess() {
		return this.firstAccess;
	}

	public void setFirstAccess(Date firstAccess) {
		this.firstAccess = firstAccess;
	}


	public Date getLastedAccess() {
		return this.lastedAccess;
	}

	public void setLastedAccess(Date lastedAccess) {
		this.lastedAccess = lastedAccess;
	}

	
	public Date getExpiredDate() {
		return this.expiredDate;
	}

	public void setExpiredDate(Date expiredDate) {
		this.expiredDate = expiredDate;
	}


	public String getLastedIpAccess() {
		return this.lastedIpAccess;
	}

	public void setLastedIpAccess(String lastedIpAccess) {
		this.lastedIpAccess = lastedIpAccess;
	}

	
	public String getLastedCompAccess() {
		return this.lastedCompAccess;
	}

	public void setLastedCompAccess(String lastedCompAccess) {
		this.lastedCompAccess = lastedCompAccess;
	}
}
